<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	  <meta charset="UTF-8">
	  <title>添加比赛</title>
	 
	  <link rel="stylesheet" href="${ctx}/static/layui-v2.3.0/layui/css/layui.css">
  </head>
  <body>
 <form class="layui-form" action="${ctx}/Mpk/saveuMatchPk" method="post">
  <input type="hidden" name="battleId" id="battleId" value="${matchPk.battleId}">
 <div class="layui-form-item">
	<label class="layui-form-label">比赛名称</label>
		<div class="layui-input-inline">
			<select name="matchId" id="matchId" lay-verify="required">	
				<c:forEach items="${matchList}" var="match" varStatus="stat">
				<c:choose>
					 <c:when test="${match.matchId==matchPk.matchId}">
					  	  <option value="${match.matchId}" selected>${match.matchName}</option>					      
					 </c:when>
			         <c:otherwise>		 
			              <option value="${match.matchId}">${match.matchName}</option>
			         </c:otherwise>
			    </c:choose>
			    </c:forEach>				 			        
			</select>
		</div>
 </div>
  
   <div class="layui-form-item">
		<label class="layui-form-label">选手1</label>
			<div class="layui-input-inline">
			   <select name="firstPlayerId" id="firstPlayerId">	
			   <c:forEach items="${playerList}" var="player" varStatus="stat">
			   		<c:choose>
						 <c:when test="${player.playerId==matchPk.firstPlayerId}">
						  	  <option value="${player.playerId}" selected>${player.playerName}</option>					      
						 </c:when>
				         <c:otherwise>		 
				              <option value="${player.playerId}">${player.playerName}</option>
				         </c:otherwise>
			         </c:choose>
	                
	           </c:forEach>			        
			   </select>
		    </div>
	</div> 
  
    <div class="layui-form-item">
    <label class="layui-form-label">第一位歌曲名</label>
    <div class="layui-input-block">
      <input type="text" name="firstSongName" value="${ matchPk.firstSongName}" placeholder="请输入比赛名称" autocomplete="off" class="layui-input">


	</div>
  </div>


    <div class="layui-form-item" >
		<label class="layui-form-label">选手2</label>
			<div class="layui-input-inline">
			<select name="secondPlayerId" id="secondPlayerId" >					    
			    <c:forEach items="${playerList}" var="player" varStatus="stat">
			    <c:choose>
						 <c:when test="${player.playerId==matchPk.secondPlayerId}">
						  	  <option value="${player.playerId}" selected>${player.playerName}</option>					      
						 </c:when>
				         <c:otherwise>		 
				              <option value="${player.playerId}">${player.playerName}</option>
				         </c:otherwise>
			         </c:choose>
		            
		        </c:forEach>			        
	        </select>
			</div>
	</div>   
  
  
    <div class="layui-form-item">
    <label class="layui-form-label">第二位歌曲名</label>
    <div class="layui-input-block">
      <input type="text" name="secondSongName" value="${ matchPk.secondSongName}" placeholder="请输入比赛名称" autocomplete="off" class="layui-input">
    </div>    
  </div>



  
  <div class="layui-form-item">
    <div class="layui-input-block">
    <input type="submit" class="layui-btn" value="提交">
     <a href="${ctx}/Mpk/selectMatchPk" class="layui-btn">返回</a>
     
    </div>
  </div>
 </form>
  <script type="text/javascript" src="${ctx}/static/layui-v2.3.0/layui/layui.js"></script>
  <script>
//Demo
  layui.use(['form', 'laydate'], function(){
	  var form = layui.form
	  ,layer = layui.layer
	  ,laydate = layui.laydate;
	  
	  //日期
	  laydate.render({
	    elem: '#date'
	  });
  //监听提交
  form.on('submit(formDemo)', function(data){
    layer.msg(JSON.stringify(data.field));
    return false;
  });
   
});
</script>
 
  </body>
</html>